//import Vue from 'vue'
import Router from 'vue-router';

Vue.use(Router)

const router = new Router({
    mode: 'history',
    routes: [{
        path: '/',
        redirect: '/home',
        component: resolve => require(['@/views/home/index.vue'], resolve),
        children: [{
            path: '/home',
            component: resolve => require(['@/views/home/home.vue'], resolve)
        }]
    },{
        path:"/test",
        component: resolve => require(['@/test/test.vue'], resolve)
    },{
        path:"/index",
        component: resolve => require(['@/views/medicine/index.vue'], resolve),
        children: [{
            path: '/index',       //药物基本信息
            component: resolve => require(['@/views/medicine/chart.vue'], resolve)
        },{
            path: '/basic',       //药物基本信息
            component: resolve => require(['@/views/medicine/basic.vue'], resolve)
        },{
            path: '/instructions',//药物说明书
            component: resolve => require(['@/views/medicine/instructions.vue'], resolve)
        },{
            path: '/interaction',  //药物相互作用
            component: resolve => require(['@/views/medicine/interaction.vue'], resolve)
        },{
            path: '/intDetails',    //药物相互作用详情
            component: resolve => require(['@/views/medicine/intDetails.vue'], resolve)
        },{
            path: '/clinicalTrial', //临床试验
            component: resolve => require(['@/views/medicine/clinicalTrial.vue'], resolve)
        },{
            path: '/medicineList', //药物列表
            component: resolve => require(['@/views/medicine/medicineList.vue'], resolve)
        },{
            path: '/targetSpot', //靶点
            component: resolve => require(['@/views/medicine/targetSpot.vue'], resolve)
        },{
            path: '/ctr', //ctr 中国临床试验详情
            component: resolve => require(['@/views/medicine/ctr.vue'], resolve)
        },{
            path: '/nct', //ctr 世界临床试验详情
            component: resolve => require(['@/views/medicine/nct.vue'], resolve)
        },{
            path: '/gene', //ctr 世界临床试验详情
            component: resolve => require(['@/views/medicine/gene.vue'], resolve)
        },{
            path: '/genomics',    //药物基因组学
            component: resolve => require(['@/views/medicine/genomics.vue'], resolve)
        },{
            path: '/chemVariation',    //化学变异
            component: resolve => require(['@/views/medicine/chemVariation.vue'], resolve)
        },{
            path: '/targetVariation',    //靶向变异
            component: resolve => require(['@/views/medicine/targetVariation.vue'], resolve)
        }]
    },{
        path:"/geneIndex",
        component: resolve => require(['@/views/gene/index.vue'], resolve),
        children: [{
            path: '/geneIndex',       //药物基本信息
            component: resolve => require(['@/views/medicine/gene.vue'], resolve)
        },{
            path: '/geneIndex/target',    //靶向变异
            component: resolve => require(['@/views/medicine/targetVariation.vue'], resolve)
        },{
            path: '/geneIndex/chem',    //化学变异
            component: resolve => require(['@/views/medicine/chemVariation.vue'], resolve)
        },{
            path: '/geneIndex/geneList',    //化学变异
            component: resolve => require(['@/views/gene/geneList.vue'], resolve)
        }]
    },{
        path:"/intIndex",
        component: resolve => require(['@/views/interaction/index.vue'], resolve),
        children: [{
            path: '/intIndex',       //药物基本信息
            component: resolve => require(['@/views/interaction/interaction.vue'], resolve)
        },{
            path: '/int/intDetails',    //化学变异
            component: resolve => require(['@/views/interaction/intDetails.vue'], resolve)
        }]
    }]
})

export default router;